<?php

$groupid    =$_POST["groupid"];
$url        =$_POST["url"];
$title      =$_POST["title"];
$sort_order =$_POST["sort_order"];
$email      =$_POST["email"];
$intro      =$_POST["intro"];
$target     =$_POST["target"];
$nofollow   =$_POST["nofollow"];
$id         =(int)$_POST["id"];

$target=$target==true?1:0;


$nofollow=$nofollow==true?1:0;


require 'database.php';

$base=new Db;

$__links__=$base->doSql('update ey_links set groupid="'.$groupid.'",url="'.$url.'",title="'.$title.'",sort_order="'.$sort_order.'",email="'.$email.'",intro="'.$intro.'",target="'.$target.'",nofollow="'.$nofollow.'",update_time="'.time().'" where id="'.$id.'"');

if($__links__){
    return json([
        "code"=>200    
    ]);
}else{
    return json([
        "code"=>-1   
    ]);
}
